package com.threefish.modules.sso.vo;


import lombok.*;
import org.nutz.json.JsonField;

/**
 * @author 黄川 306955302@qq.com
 * @date: 2018/5/25
 * 对老系统单点登录
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@RequiredArgsConstructor
public class SsoResultVO {
    /**
     * 状态
     */

    @JsonField("Success")
    @NonNull
    private Boolean success;
    /**
     * 错误消息
     */
    @JsonField("ErrorMessage")
    private String errorMessage;
    /**
     * 账号
     */
    @JsonField("UserName")
    @NonNull
    private String userName;
    /**
     * 身份证号码
     */
    @JsonField("UserIdentity")
    @NonNull
    private String userIdentity;


    public static SsoResultVO sucess(String userName, String userIdentity) {
        return new SsoResultVO(true, userName, userIdentity);
    }

    public static SsoResultVO error(String errorMessage) {
        return new SsoResultVO(false, errorMessage, null, null);
    }

}
